<?php /* Smarty version Smarty-3.1.18, created on 2017-05-17 08:15:47
         compiled from "/data/www/mystery/protected/modules/webadmin/views/network/list.tpl" */ ?>
<?php /*%%SmartyHeaderCode:149154970054bfaf2f8cc6d9-65325265%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'fabbd3619c17dbbebd9c3439f7cfa46fdc211f4c' => 
    array (
      0 => '/data/www/mystery/protected/modules/webadmin/views/network/list.tpl',
      1 => 1494904922,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '149154970054bfaf2f8cc6d9-65325265',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.18',
  'unifunc' => 'content_54bfaf2f93b3c6_41572848',
  'variables' => 
  array (
    'banklist' => 0,
    'key' => 0,
    'bank_id' => 0,
    'val' => 0,
    'level' => 0,
    'select_level' => 0,
    'network_num' => 0,
    'network_name' => 0,
    'list' => 0,
    'page' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_54bfaf2f93b3c6_41572848')) {function content_54bfaf2f93b3c6_41572848($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ("../common/header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

<table width="100%" border="0" cellspacing="0">
 <tr>
    <td width="13%" valign="top">
            <?php echo $_smarty_tpl->getSubTemplate ("../common/left.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

    </td>
    <td width="87%" valign="top">
        
        <table width="100%" border="0" cellspacing="0">
                <tr>
                <td>
                    <div class="subnav">
                    <div class="content-menu ib-a blue line-x"> 
                    <form name="form1" method="get" action="/webadmin/network/list">
                    <div class="explain-col">
                        所属银行：<select name="bank_id">
                                    <option value="0">所有</option>
                                    <?php  $_smarty_tpl->tpl_vars['val'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['val']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['banklist']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['val']->key => $_smarty_tpl->tpl_vars['val']->value) {
$_smarty_tpl->tpl_vars['val']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['val']->key;
?>
                                      <option value="<?php echo $_smarty_tpl->tpl_vars['key']->value;?>
" <?php if ($_smarty_tpl->tpl_vars['bank_id']->value==$_smarty_tpl->tpl_vars['key']->value) {?>selected="selected"<?php }?>><?php echo $_smarty_tpl->tpl_vars['val']->value;?>
</option>
                                    <?php } ?>
                                </select>
								网点级别：<select name="level">
								<option value="0">所有</option>
								<?php  $_smarty_tpl->tpl_vars['val'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['val']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['level']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['val']->key => $_smarty_tpl->tpl_vars['val']->value) {
$_smarty_tpl->tpl_vars['val']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['val']->key;
?>
								<option value="<?php echo $_smarty_tpl->tpl_vars['key']->value;?>
" <?php if ($_smarty_tpl->tpl_vars['select_level']->value==$_smarty_tpl->tpl_vars['key']->value) {?>selected="selected"<?php }?>><?php echo $_smarty_tpl->tpl_vars['val']->value['desc'];?>
</option>
								<?php } ?>
								</select>
              网点编号：<input type="text" name="network_num" class="input-text" value="<?php echo $_smarty_tpl->tpl_vars['network_num']->value;?>
">
              网点名称：<input type="text" name="network_name" class="input-text" value="<?php echo $_smarty_tpl->tpl_vars['network_name']->value;?>
">
                        <input type="submit" name="dosubmit" class="button" value="搜索"> 
                        <div class="right">
                        <a href="/webadmin/network/import"><em>网点信息导入</em></a><span>|</span>
                        <a href="javascript:void(0);" onclick="export1();"><em>网点信息导出</em></a>
                        </div>
                    </div>
                        
                          <div class="left pr40">
                          <a class="on" href="javascript:;"><em>网点信息管理</em></a><span>|</span>
                          <a href="/webadmin/network/add"><em>添加网点</em></a><span>|</span>
                          </div>
               

                          </form>
                     <div class="clearbox"></div>
                    </div>
                  </div>
              <div class="pad_10">
                <div class="table-list">
                <table width="100%">
                      <thead>
                        <tr>
                            <th width="10%">网点编号</th>
                            <th width="15%" >网点名称</th>
                            <th width="20%">所属银行</th>
                            <th width="10%">登陆帐号</th>
                            <th width="10%">登陆密码</th>
                            <th width="10%">报备</th>
                            <th width="25%">管理操作</th>
                        </tr>
                      </thead>
                      <tbody>
                        <?php  $_smarty_tpl->tpl_vars['val'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['val']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['list']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['val']->key => $_smarty_tpl->tpl_vars['val']->value) {
$_smarty_tpl->tpl_vars['val']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['val']->key;
?> 
                        <tr id="network_<?php echo $_smarty_tpl->tpl_vars['val']->value['network_id'];?>
">
                            <td align="center"><?php echo $_smarty_tpl->tpl_vars['val']->value['network_num'];?>
</td>
                            <td align="center" align="left"><?php echo $_smarty_tpl->tpl_vars['val']->value['network_name'];?>
</td>
                            <td align="center"><?php echo $_smarty_tpl->tpl_vars['banklist']->value[$_smarty_tpl->tpl_vars['val']->value['bank_id']];?>
</td>
                            <td align="center"><?php echo $_smarty_tpl->tpl_vars['val']->value['network_username'];?>
</td>
                            <td align="center"><?php echo $_smarty_tpl->tpl_vars['val']->value['network_pwd'];?>
</td>
                            <td align="center">

                                    <?php if ($_smarty_tpl->tpl_vars['val']->value['open_report']>=1) {?>
                                    <a href="javascript:;" id="report_<?php echo $_smarty_tpl->tpl_vars['val']->value['network_id'];?>
" style="color:red;" onclick="open_report(<?php echo $_smarty_tpl->tpl_vars['val']->value['network_id'];?>
, 0,<?php echo $_smarty_tpl->tpl_vars['val']->value['up_network_id'];?>
)">已开通</a>
                                    <?php } else { ?>
                                    <a href="javascript:;" id="report_<?php echo $_smarty_tpl->tpl_vars['val']->value['network_id'];?>
" style="color:blue;" onclick="open_report(<?php echo $_smarty_tpl->tpl_vars['val']->value['network_id'];?>
, 1,<?php echo $_smarty_tpl->tpl_vars['val']->value['up_network_id'];?>
)">未开通</a>
                                    <?php }?>
   
                            </td>
                            <td align="center">
                                <?php if ($_smarty_tpl->tpl_vars['val']->value['level']!=4) {?><a href="/webadmin/network/add?up_network_id=<?php echo $_smarty_tpl->tpl_vars['val']->value['network_id'];?>
">添加下级</a> | <?php }?>
                                <a href="javascript:;" onclick="add_attach(<?php echo $_smarty_tpl->tpl_vars['val']->value['network_id'];?>
);">添加附件</a> | 
                            <a href="/webadmin/network/edit?network_id=<?php echo $_smarty_tpl->tpl_vars['val']->value['network_id'];?>
">修改</a> | 
                            <a name="delete" href="javascript:void(0);" rel="<?php echo $_smarty_tpl->tpl_vars['val']->value['network_id'];?>
">删除</a>
                            </td>
                        </tr>       
                        <?php } ?>
                         
                      </tbody>
                </table>
                        <div style="float:right;"><?php echo $_smarty_tpl->tpl_vars['page']->value;?>
</div>
                </div>
              </div>
            </td>
		  </tr>
		</table>
    </td>
 </tr>
</table>
<script type="text/javascript">
$(document).ready(function($) {
	$('a[name="delete"]').click(function() {
		var id = $(this).attr('rel');
		if (id == ''){
			return false;
		}
		$or = confirm('你确定要删除吗？');
		if($or){
	  		$.ajax({
	 			 type:'post',
	 			 async : true,
				 dataType:"json",
				 data: {'network_id':id},
	 			 url:'/webadmin/network/delete',
	 			 success:function(data){
	 				alert(data.note);
	 				if(!data.status){
						return false ;
					}else{
						$('#network_'+id).remove();
					}
	 			 }
	 		});
	  	}
	});
	
});
//导出网点excel
function export1(){
    $.layer({
        type: 2, 
        title: '网点信息导出',
        border:[10, 0.3, '#000'],
        closeBtn:[0, true],
        shade: [0.5, '#000'],
        offset: ['100px', ''],
        area: ['300px', '200px'],
        iframe: {src: '/webadmin/network/export'}
     });
}
function add_attach(network_id){
    $.layer({
        type: 2, 
        title: '网点附件上传',
        border:[10, 0.3, '#000'],
        closeBtn:[0, true],
        shade: [0.5, '#000'],
        offset: ['100px', ''],
        area: ['400px', '400px'],
        iframe: {src: '/webadmin/network/Attach?network_id='+network_id}
     });
}
//开通网点报备
function open_report(network_id, report,up_network_id){
    $.getJSON('/webadmin/network/Report',{network_id:network_id,report:report,up_network_id:up_network_id},function(res){
        alert(res.note);
        if (res.status==1) {
            //if (report ==1) {
                //$('#report_'+network_id).html('<font style="color:red;">已开通</font>');
            //} else {
                //$('#report_'+network_id).html('<font style="color:blue;"未开通</font>');
            //}
            window.location.reload();
        }
        
    });
}
</script>
<?php echo $_smarty_tpl->getSubTemplate ("../common/footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
<?php }} ?>
